#!/bin/bash

# * 
# * File         : rsync_rc.sh
# * Version      : 0.1
# * CreateTime   : 2024-05-19 07:18:05
# * LastEdit     : 2024-12-07 00:04:54
# * Author       : Knat
# * Licence      : Copyright © 2024 Knat. All Rights Reserved.
# * Desc         : 用 rsync 来增量备份配置。
# * 

# fstab
rsync -avvP /etc/fstab ~/Public/my-rc/HomeRC
# openbox
rsync -avvP ~/.config/openbox ~/Public/my-rc/HomeRC

# rime 
rsync -avvP --exclude={'build','sync','pinyin_simp.userdb','pinyin_simp.userdb.txt'} ~/.local/share/fcitx5/rime/sync/51f52ce6-8ac7-40dc-9ee8-cd3eec19048d ~/Public/my-rc/rime
rm -rf ~/Public/my-rc/rime/build
rm -rf ~/Public/my-rc/rime/sync
rm -rf ~/Public/my-rc/rime/pinyin_simp.userdb

# copyQ剪贴板
rsync -avvP ~/.config/copyq ~/Public/my-rc/HomeRC
# tint2 & rofi & dunst & picom & rox-filer & zathura,all work with openbox
rsync -avvP ~/.config/tint2 ~/Public/my-rc/HomeRC
rsync -avvP --exclude='themes' ~/.config/rofi ~/Public/my-rc/HomeRC
rm -rf ~/Public/my-rc/HomeRC/rofi/themes/
rsync -avvP ~/.config/dunst ~/Public/my-rc/HomeRC
rsync -avvP ~/.config/picom ~/Public/my-rc/HomeRC
rsync -avvP ~/.config/rox.sourceforge.net ~/Public/my-rc/HomeRC
rsync -avvP ~/.config/zathura ~/Public/my-rc/HomeRC

# aria2
rsync -avvP ~/.config/aria2 ~/Public/my-rc/HomeRC
# conky
rsync -avvP ~/.config/conky ~/Public/my-rc/HomeRC

#aucadious skin
rsync -avvP --exclude='playlists' ~/.config/audacious ~/Public/my-rc/HomeRC
rm -rf ~/Public/my-rc/HomeRC/audacious/playlists/
# geany
rsync -avvP ~/.config/geany ~/Public/my-rc/HomeRC
# Xresource for urxvt & uxterm
mkdir -p ~/Public/my-rc/HomeRC/urxvt/
rsync -avvP ~/.Xresources ~/Public/my-rc/HomeRC/urxvt/Xresources

# zshrc & bashrc
mkdir -p ~/Public/my-rc/HomeRC/shell/
rsync -avvP ~/.zshrc ~/Public/my-rc/HomeRC/shell/.zshrc
rsync -avvP ~/.bashrc ~/Public/my-rc/HomeRC/shell/.bashrc

# vim & nvim
rsync -avvP --exclude='plugged' ~/.vim/ ~/Public/my-rc/vim
rsync -avvP --exclude='plugged' ~/.config/nvim/  ~/Public/my-rc/nvim
rm -rf ~/Public/my-rc/vim/plugged
rm -rf ~/Public/my-rc/nvim/plugged
rsync -avvP ~/.config/nvim/init.vim ~/Public/my-rc/nvim/init.vim
rsync -avvP ~/.vimrc ~/Public/my-rc/vim/vimrc

# zim wiki
rsync -avvP ~/.config/zim ~/Public/my-rc/HomeRC

#Autokey
rsync -avvP ~/.config/autokey ~/Public/my-rc/HomeRC

# FBreader
rsync -avvP ~/.FBReader ~/Public/my-rc/HomeRC
rm -rf ~/Public/my-rc/HomeRC/.FBReader/cache

#DoubleCMD
rsync -avvP ~/.config/doublecmd ~/Public/my-rc/HomeRC

#ranger
rsync -avvP --exclude='__pycache__' ~/.config/ranger ~/Public/my-rc/HomeRC
rm -rf ~/Public/my-rc/HomeRC/ranger/plugins/__pycache__

#alacritty
rsync -avvP ~/.config/alacritty ~/Public/my-rc/HomeRC

# keepassxc
rsync -avvP ~/.config/keepassxc ~/Public/my-rc/HomeRC

# i3wm config
rsync -avvP ~/.config/i3 ~/Public/my-rc/HomeRC
rsync -avvP ~/.config/i3blocks ~/Public/my-rc/HomeRC

# mpv.conf
rsync -avvP ~/.config/mpv/mpv.conf ~/Public/my-rc/HomeRC/mpv/

#~/.config/autostart
rsync -avvP ~/.config/autostart ~/Public/my-rc/HomeRC

git status
